]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
altTab: fix destroy-without-showing case
authorDan Winship <danw@gnome.org>
Thu, 6 Jan 2011 18:38:41 +0000 (13:38 -0500)
committerDan Winship <danw@gnome.org>
Thu, 6 Jan 2011 18:38:41 +0000 (13:38 -0500)
If the switcher is destroyed without ever being fully shown (either
because it couldn't get a keyboard grab, or just because there are no
apps to display), destroy it immediately rather than tweening it
towards destruction, since its contents haven't been built yet and
_allocate() will throw errors if it runs.

js/ui/altTab.js

index ca2b902be94e215d6ee31ca32b51a667c012070e..b117fc8400f50727292d82f82fd13bc8f0c3f0c2 100644 (file)
@@ -34,7 +34,8 @@ function AltTabPopup() {
 AltTabPopup.prototype = {
     _init : function() {
         this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
-                                                    reactive: true });
+                                                  reactive: true,
+                                                  visible: false });
 
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
@@ -365,15 +366,18 @@ AltTabPopup.prototype = {
     },
 
     destroy : function() {
-        Tweener.addTween(this.actor,
-                         { opacity: 0,
-                           time: POPUP_FADE_TIME,
-                           transition: 'easeOutQuad',
-                           onComplete: Lang.bind(this,
-                               function() {
-                                   this.actor.destroy();
-                               })
-                         });
+        if (this.actor.visible) {
+            Tweener.addTween(this.actor,
+                             { opacity: 0,
+                               time: POPUP_FADE_TIME,
+                               transition: 'easeOutQuad',
+                               onComplete: Lang.bind(this,
+                                   function() {
+                                       this.actor.destroy();
+                                   })
+                             });
+        } else
+            this.actor.destroy();
     },
 
     _onDestroy : function() {